<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>轮播管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__CSS__/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__CSS__/animate.css" rel="stylesheet">
    <link href="__CSS__/style.css?v=4.1.0" rel="stylesheet">



    <style>
        #file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }
        #file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }
        #files {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }
        #files input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

    </style>
</head>

<body class="gray-bg">
<div><h1>模块样式1管理</h1></div>
<div class="container">
    <div class="rwo">
        <a class="col-xs-3 col-xs-offset-3 btn btn-lg btn-danger" href="{:url('Website/add_module')}">添加</a>
    </div>

    </div>
</div>

<div class="row">

    <table class="table table-hover table-bordered text-center">
        <thead >
        <tr >
            <th class="text-center">模块id</th>
            <th class="text-center">名字</th>
            <th class="text-center">内容1</th>
            <th class="text-center">内容2</th>
            <th class="text-center">内容3</th>
            <th class="text-center">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="content" id="value"}
            <tr>
                <td>{$value.id}</td>
                <td>{$value.name}</td>


                {volist name="$value.content" id="val"}
                <td>{$val}</td>
                {/volist}

                <td>
                    <a  class="btn btn-danger" href="{:url('Website/update_module')}?id={$value.id}">update</a>
                    <a  class="btn btn-default" href="{:url('Website/read_module')}?id={$value.id}">read</a>
                    <a  class="btn btn-danger" onclick="delete_module('{$value.id}')">delete</a>
                </td>
            </tr>
        {/volist}
        </tbody>
    </table>

</div>
</div>


<!-- 全局js -->
<script src="__JS__/jquery.min.js?v=2.1.4"></script>
<script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
<script src="__JS__/jquery.validate.js"> </script>


<!-- 自定义js -->
<script>
    var deleteurl="{:url('Website/delete_module')}";

    function delete_module(module_id) {
        if(confirm("你确定要删除这一项")){
            $.ajax({
                url:deleteurl,
                type:"post",
                dataType:"text",
                data:{
                    module_id:module_id,
                },
                success:function (data) {
                    if(data==1){
                        alert("删除成功")
                        history.go(0);
                    }else {
                        alert("删除失败");
                    }
                },
                error:function (e) {
                    alert(e.response)
                }
            })

        }

    }
</script>







</body>

</html>
